<template>
    <a-spin :spinning="confirmLoading">
        <a-tabs default-active-key="1" @change="tabChange">
            <a-tab-pane key="1" tab="基本信息">
                <j-form-container :disabled="formDisabled">
                    <a-form :form="form" slot="detail" layout="vertical">
                        <a-row>
                            <a-col :span="24">
                                <a-form-item label="发货企业名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['deliverCompany']" placeholder="请输入发货企业名称"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="车牌号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['plateNo']" placeholder="请输入车牌号"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="挂车号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['trailerNo']" placeholder="请输入挂车号"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="司机姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['driverName']" placeholder="请输入司机姓名"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="身份证号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['idCard']" placeholder="请输入身份证号"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['phoneNum']" placeholder="请输入手机号"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="业务类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-dict-select-tag type="list" v-decorator="['businessType']" :trigger-change="true"
                                        dictCode="business_type" placeholder="请选择业务类型" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="运输状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-dict-select-tag type="list" v-decorator="['transportStatus']"
                                        :trigger-change="true" dictCode="transport_status" placeholder="请选择运输状态" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="产品类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-dict-select-tag type="list" v-decorator="['productionType']"
                                        :trigger-change="true" dictCode="production_type" placeholder="请选择产品类型" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['productionName']" placeholder="请输入产品名称"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="油品等级" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['oilGrade']" placeholder="请输入油品等级"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="是否转基因" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-dict-select-tag type="radio" v-decorator="['isTransgenosis']"
                                        :trigger-change="true" dictCode="yn" placeholder="请选择是否转基因" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="卸货方向" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-dict-select-tag type="list" v-decorator="['unloadingDirection']"
                                        :trigger-change="true" dictCode="unloading_direction" placeholder="请选择卸货方向" />
                                </a-form-item>
                            </a-col>
                            <div v-for="(item, index) in model.healthCertificateDetail" :key="index">
                                <a-col :span="13">
                                    <a-form-item label="健康证" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                        <j-image-upload isMultiple :value="item.healthCertificate" style="flex: 1" />
                                    </a-form-item>
                                </a-col>
                                <a-col :span="11">
                                    <a-form-item label="是否在有效期内" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                        <a-radio-group v-model="item.isEffective">
                                            <a-radio :value="1">是</a-radio>
                                            <a-radio :value="0">否</a-radio>
                                        </a-radio-group>
                                    </a-form-item>
                                </a-col>
                            </div>
                            <a-col :span="12">
                                <a-form-item label="身份证" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['identityCard']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="行驶证" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['vehicleLicense']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="驾驶证" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['driverLicense']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="营运证" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['tradingCard']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="所属运输企业名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['fleet']" placeholder="请输入所属运输企业名称"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="收货企业名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['receiptCompany']" placeholder="请输入收货企业名称"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="车体是否有食用油专用标签" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-dict-select-tag type="radio" v-decorator="['isEdibleOilLabel']"
                                        :trigger-change="true" dictCode="is_edible_oil_label"
                                        placeholder="请选择车体是否有食用油专用标签" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="运输方签字" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['driverSign1']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                        </a-row>
                    </a-form>
                </j-form-container>
            </a-tab-pane>
            <a-tab-pane key="2" tab="三载信息">
                <j-form-container :disabled="formDisabled">
                    <a-form :form="form" slot="detail" layout="vertical">
                        <a-row>
                            <a-col :span="24">
                                <a-form-item label="前一载提货公司" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-textarea v-decorator="['lastTimePickUpCompanyName1']" placeholder="请输入前一载提货公司"
                                        :auto-size="{ minRows: 1, maxRows: 5 }" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="前一载卸货公司" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-textarea v-decorator="['lastTimeUnloadingCompanyName1']" placeholder="请输入前一载卸货公司"
                                        :auto-size="{ minRows: 1, maxRows: 5 }" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="前一载卸货日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-date placeholder="请选择前一载卸货日期" v-decorator="['lastTimeUnloadingDate1']"
                                        :trigger-change="true" style="width: 100%" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="前一载卸车货品名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-textarea v-decorator="['lastTimeUnloadingGoodsName1']" placeholder="请输入前一载卸车货品名称"
                                        :auto-size="{ minRows: 1, maxRows: 5 }" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="前二载提货公司" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-textarea v-decorator="['lastTimePickUpCompanyName2']" placeholder="请输入前二载提货公司"
                                        :auto-size="{ minRows: 1, maxRows: 5 }" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="前二载卸货公司" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-textarea v-decorator="['lastTimeUnloadingCompanyName2']" placeholder="请输入前二载卸货公司"
                                        :auto-size="{ minRows: 1, maxRows: 5 }" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="前二载卸货日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-date placeholder="请选择前二载卸货日期" v-decorator="['lastTimeUnloadingDate2']"
                                        :trigger-change="true" style="width: 100%" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="前二载卸车货品名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-textarea v-decorator="['lastTimeUnloadingGoodsName2']" placeholder="请输入前二载卸车货品名称"
                                        :auto-size="{ minRows: 1, maxRows: 5 }" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="前三载提货公司" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-textarea v-decorator="['lastTimePickUpCompanyName3']" placeholder="请输入前三载提货公司"
                                        :auto-size="{ minRows: 1, maxRows: 5 }" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="前三载卸货公司" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-textarea v-decorator="['lastTimeUnloadingCompanyName3']" placeholder="请输入前三载卸货公司"
                                        :auto-size="{ minRows: 1, maxRows: 5 }" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="前三载卸货日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-date placeholder="请选择前三载卸货日期" v-decorator="['lastTimeUnloadingDate3']"
                                        :trigger-change="true" style="width: 100%" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="前三载卸车货品名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-textarea v-decorator="['lastTimeUnloadingGoodsName3']" placeholder="请输入前三载卸车货品名称"
                                        :auto-size="{ minRows: 1, maxRows: 5 }" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="三载卸货照片" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple
                                        v-decorator="['lastTimeUnloadingPhotos']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="前三载证明文件" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['documentation']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="送货磅单" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['poundListPhoto1']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="上次清洗时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-date placeholder="请选择上次清洗时间" v-decorator="['lastTimeCleaningDate']"
                                        :trigger-change="true" style="width: 100%" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="清罐方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-dict-select-tag type="radio" v-decorator="['cleaningWay']" :trigger-change="true"
                                        dictCode="cleaning_way" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="上次清洗证明和发票" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple
                                        v-decorator="['lastTimeCleaningPhotos']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="随车装运记录" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['onboardRecordForm']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="gps截图" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['screenshot']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="初审签字" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['inspectorSign1']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="二审签字" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['inspectorSign2']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                        </a-row>
                    </a-form>
                </j-form-container>
                <a-col :span="24" v-show="model.auditStatus == 1" v-has="'tanker:examine1'">
                    <a-form-item label="驳回原因" :labelCol="labelCol" :wrapperCol="wrapperCol">
                        <a-input v-model="model.rejectReason" placeholder="请输入驳回原因"></a-input>
                    </a-form-item>
                </a-col>
                <a-col :span="12" v-show="model.auditStatus == 1" v-has="'tanker:examine1'">
                    <a-button @click="showSignDialog('物流储运部初审', 2)" type="primary"
                        style="margin-left: 8px">初审通过</a-button>
                </a-col>
                <a-col :span="12" v-show="model.auditStatus == 1" v-has="'tanker:examine1'">
                    <a-button @click="showSignDialog('物流储运部初审', 3)" type="primary"
                        style="margin-left: 8px">初审驳回</a-button>
                </a-col>
                <a-col :span="24" v-show="model.auditStatus == 2" v-has="'tanker:examine2'">
                    <a-form-item label="驳回原因" :labelCol="labelCol" :wrapperCol="wrapperCol">
                        <a-input v-model="model.rejectReason" placeholder="请输入驳回原因"></a-input>
                    </a-form-item>
                </a-col>
                <a-col :span="12" v-show="model.auditStatus == 2" v-has="'tanker:examine2'">
                    <a-button @click="showSignDialog('物流储运部二审', 4)" type="primary"
                        style="margin-left: 8px">二审通过</a-button>
                </a-col>
                <a-col :span="12" v-show="model.auditStatus == 2" v-has="'tanker:examine2'">
                    <a-button @click="showSignDialog('物流储运部二审', 5)" type="primary"
                        style="margin-left: 8px">二审驳回</a-button>
                </a-col>
            </a-tab-pane>
            <a-tab-pane key="3" tab="查验信息">
                <j-form-container :disabled="formDisabled">
                    <a-form :form="form" slot="detail" layout="vertical">
                        <a-row>
                            <a-col :span="12">
                                <a-form-item label="车头照片" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['headstockPhoto']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="车身照片" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['vehiclePhoto']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="车尾照片" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['rearPhoto']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="铅封照片" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['leadSealingPic1']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="进油口照片" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['oilInletPhoto']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="司机查验签字" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['driverSign2']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="查验人签字" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['inspectorSign3']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            1.散装食用油运输应使用食用油专用运输车辆，罐体上有“食用油专用”“食用植物油专用”或类似标识，运输罐车的标识和字样应清晰、完整，应为车罐原有标识（喷涂或粘贴），不得有简易粘贴、覆盖、涂改等明显修改痕迹，不得含有“工业、爆、腐、易燃、白油”等字样。
                                            2.船舶应以“船舶营业运输证”确认船舶是否为食用油专用。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank1']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            信息应包括本车车牌号（船号）、挂车号、前三次运输货物的日期、品种、等级、提货地点、收货地点、是否转基因等信息。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank2']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            应加盖运输服务方、供应商或客户公章，或其他能体现合同履约关系的单位印章。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank3']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            ※当出现下列情况时，应提供清罐（舱）证明：
                                            （1）发现运输容器内气味异常、内壁不洁、底部有积存沉淀物时,应及时清洁。（清洁包括清理和清洗）
                                            （2）运输某一品种的成品油后再运输另一品种的成品油或运输低等级成品油后再运输高等级成品油,应先将容器内的残留物清除干净,并对容器进行擦拭等清理。
                                            （3）运输原油后再运输成品油、运输转基因油后再运输非转基因油或运输其他食品后再运输食用油的，应先将容器内的残留物清除干净,并对容器进行清洗,清洗后的容器内壁应无明水、无残留物、无异味。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank4']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            ※前三载证明中不允许出现化工等非食品承运记录，一经发现，不论是否进行清罐，一律拒绝装卸，并将此车车号列入黑名单。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank5']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            清罐（舱）证明应显示清罐结果为“合格”，应清晰体现车牌号（船号）、挂车号、清罐（舱）时间、清罐（舱）方式、清洗剂（如涉及）等信息，有清罐（舱）人、查验（舱）人签字（不能为同一个人），并加盖清洗单位印章。其中清洗剂应符合GB14930.1的要求，清洁用水应符合GB5749的要求。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank6']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            1.用于食用油运输的罐车容器、进出口接触面、输送物料管道等应符合国标要求，罐车容器内层应为不锈钢材质或符合食品安全的其他材质，运输车辆容器装卸口阀门连接的阀门、柔性管道等配件及接油容器应为食品级材质。
                                            2.船舶应以“船舶营业运输证”确认船舶材质是否符合食用油运输要求。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank7']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            不得使用老化、易腐蚀、易脱落等不适宜的垫圈、密封隔垫或塑料布进行密封，尽可能规避塑化剂污染风险。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank8']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            外观清洁、无污染、无异物、无异味、无明显污渍。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank9']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            ※卸货车辆（船舶）无法查查验（舱）内清洁状况的，验车（船）人员和承运方应同时在场对运输容器铅封(包括电子铅封)进行检查,确认铅封号和铅封完好、未被破坏，并拍照留存。随行文件核对无误后签字确认,方能启封卸油。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank10']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            ※查验项目应覆盖到所有的油脂出入口、人孔等，应对罐（舱）体内部、装卸口阀门、铅封拍照留存。查验（舱）结束后，查验（舱）人员应清点查验（舱）工具，确保无遗漏。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank11']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item :labelCol="labelCol1" :wrapperCol="wrapperCol">
                                    <template slot="label">
                                        <div style="white-space: pre-line">
                                            ※罐车查验工作应在视频监控全覆盖区域进行（验船区域根据实际情况做调整），查验过程中须佩戴执法记录仪进行记录，保留证据文件。
                                        </div>
                                    </template>
                                    <j-dict-select-tag type="radio" v-decorator="['tank12']" :trigger-change="true"
                                        dictCode="yn" />
                                </a-form-item>
                            </a-col>
                        </a-row>
                    </a-form>
                </j-form-container>
            </a-tab-pane>
            <a-tab-pane key="4" tab="取样查验">
                <j-form-container :disabled="formDisabled">
                    <a-form :form="form" slot="detail" layout="vertical">
                        <a-row>
                            <a-col :span="24">
                                <a-form-item label="检验结论" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['checkResult']" placeholder="请输入检验结论"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="取样检测签字" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['inspectorSign4']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                        </a-row>
                    </a-form>
                </j-form-container>
            </a-tab-pane>
            <!-- <a-tab-pane key="5" tab="物流查验">
                <j-form-container :disabled="formDisabled">
                    <a-form :form="form" slot="detail" layout="vertical">
                        <a-row>
                            <a-col :span="24">
                                <a-form-item label="送货磅单" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['poundListPhoto1']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                        </a-row>
                    </a-form>
                </j-form-container>
            </a-tab-pane> -->
            <a-tab-pane key="6" tab="出厂留存">
                <j-form-container :disabled="formDisabled">
                    <a-form :form="form" slot="detail" layout="vertical">
                        <a-row>
                            <a-col :span="24">
                                <a-form-item label="卸货通知单" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['noticeOfDischarge']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="上传人员签字" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-image-upload isMultiple v-decorator="['inspectorSign5']"></j-image-upload>
                                </a-form-item>
                            </a-col>
                        </a-row>
                    </a-form>
                </j-form-container>
            </a-tab-pane>
            <a-tab-pane key="7" tab="其他信息">
                <j-form-container :disabled="formDisabled">
                    <a-form :form="form" slot="detail" layout="vertical">
                        <a-row>
                            <a-col :span="12">
                                <a-form-item label="初审审核人" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['auditName1']" placeholder="请输入初审审核人" disabled></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="初审审核时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-date placeholder="请选择初审审核时间" v-decorator="['auditTime1']" :trigger-change="true"
                                        :show-time="true" disabled date-format="YYYY-MM-DD HH:mm:ss"
                                        style="width: 100%" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="二次审核人" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['auditName2']" placeholder="请输入二次审核人" disabled></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="二次审核时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-date placeholder="请选择二次审核时间" v-decorator="['auditTime2']" :trigger-change="true"
                                        :show-time="true" disabled date-format="YYYY-MM-DD HH:mm:ss"
                                        style="width: 100%" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="查验人" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['surveyorName']" placeholder="请输入查验人" disabled></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="查验时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-date placeholder="请选择查验时间" v-decorator="['surveyorTime']" :trigger-change="true"
                                        :show-time="true" disabled date-format="YYYY-MM-DD HH:mm:ss"
                                        style="width: 100%" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="取样人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['samplingName']" disabled placeholder="请输入取样人员"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="取样时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-date placeholder="请选择取样时间" v-decorator="['samplingTime']" :trigger-change="true"
                                        :show-time="true" disabled date-format="YYYY-MM-DD HH:mm:ss"
                                        style="width: 100%" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="上传人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['leadSealingName']" disabled placeholder="请输入上传人员"></a-input>
                                </a-form-item>
                            </a-col>
                            <a-col :span="12">
                                <a-form-item label="上传时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <j-date placeholder="请选择上传时间" v-decorator="['leadSealingTime']"
                                        :trigger-change="true" :show-time="true" disabled
                                        date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
                                </a-form-item>
                            </a-col>
                            <a-col :span="24">
                                <a-form-item label="驳回原因" :labelCol="labelCol" :wrapperCol="wrapperCol">
                                    <a-input v-decorator="['rejectReason']" placeholder="请输入驳回原因"></a-input>
                                </a-form-item>
                            </a-col>
                        </a-row>
                    </a-form>
                </j-form-container>
            </a-tab-pane>
        </a-tabs>
        <SignImgDialog v-if="signVisible" ref="SignImg" :lineWidth='3' @close="closeDialog" />
        <j-form-container :disabled="formDisabled">
            <a-form :form="form" slot="detail">
                <a-row>
                    <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
                        <a-button @click="submitForm">提 交</a-button>
                    </a-col>
                </a-row>
            </a-form>
        </j-form-container>
    </a-spin>
</template>

<script>

import { httpAction, getAction, postAction } from '@/api/manage'
import pick from 'lodash.pick'
import { validateDuplicateValue } from '@/utils/util'
import SignImgDialog from '@/views/signature/SignImgDialog'

export default {
    name: 'TankerRegistrationForm',
    components: {
        SignImgDialog
    },
    props: {
        //流程表单data
        formData: {
            type: Object,
            default: () => { },
            required: false
        },
        //表单模式：true流程表单 false普通表单
        formBpm: {
            type: Boolean,
            default: false,
            required: false
        },
        //表单禁用
        disabled: {
            type: Boolean,
            default: false,
            required: false
        }
    },
    data() {
        return {
            form: this.$form.createForm(this),
            model: {},
            labelCol: {
                xs: { span: 24 },
                sm: { span: 5 },
            },
            labelCol1: {
                xs: { span: 24 },
                sm: { span: 24 },
            },
            wrapperCol: {
                xs: { span: 24 },
                sm: { span: 16 },
            },
            confirmLoading: false,
            validatorRules: {
            },
            url: {
                add: "/tankerRegistration/tankerRegistration/add",
                edit: "/tankerRegistration/tankerRegistration/edit",
                queryById: "/tankerRegistration/tankerRegistration/queryById",
                queryByTankerId: "/healthCertificateDetail/healthCertificateDetail/m/queryByTankerId",
                triCarryExamine: "/tankerRegistration/tankerRegistration/triCarryExamine",
            },
            signVisible: false,
        }
    },
    computed: {
        formDisabled() {
            if (this.formBpm === true) {
                if (this.formData.disabled === false) {
                    return false
                }
                return true
            }
            return this.disabled
        },
        showFlowSubmitButton() {
            if (this.formBpm === true) {
                if (this.formData.disabled === false) {
                    return true
                }
            }
            return false
        }
    },
    created() {
        //如果是流程中表单，则需要加载流程表单data
        this.showFlowData();
    },
    methods: {
        // 显示签名框
        showSignDialog(text, status) {
            if (status == 3 || status == 5) {
                if (!this.model.rejectReason) {
                    this.$message.error('请输入驳回原因')
                    return
                }
            }
            this.signVisible = true;
            this.$nextTick(() => {
                this.$refs.SignImg.show(text, status);
            });
        },
        // 处理签名框关闭
        closeDialog(e) {
            this.signVisible = false;
            console.log(e)
            if (e.url) {
                // 这里可以处理签名成功后的逻辑
                this.model.auditStatus = e.status;
                console.log('签名图片url:', e.url);
                if (this.model && (this.model.auditStatus === 2 || this.model.auditStatus === 3)) {
                    this.model.inspectorSign1 = e.url;
                } else if (this.model && (this.model.auditStatus === 4 || this.model.auditStatus === 5)) {
                    this.model.inspectorSign2 = e.url;
                }
                console.log(this.model)
                postAction(this.url.triCarryExamine, this.model).then(res => {
                    if (res.success) {
                        this.$message.success(res.message)
                    } else {
                        this.$message.warning(res.message)
                    }
                })
            } else {
                // 签名取消
                this.$message.info('签名已取消');
            }
        },
        queryByTankerId(id) {
            getAction(this.url.queryByTankerId, { id: id }).then(res => {
                if (res.code === 200) {
                    this.$set(this.model, 'healthCertificateDetail', res.result)
                }
            })
        },
        tabChange() {
            this.$nextTick(() => {
                this.form.setFieldsValue(pick(this.model, 'tank1', 'tank2', 'tank3', 'tank4', 'tank5', 'tank6', 'tank7',
                    'tank8', 'tank9', 'tank10', 'tank11', 'tank12', 'tank13', 'tank14', 'tank15', 'tank16', 'tank17',
                    'tank18', 'tank19', 'tank20', 'tank21', 'tank22', 'tank23', 'tank24', 'deliverCompany', 'receiptCompany',
                    'fleet', 'driverName', 'phoneNum', 'idCard', 'plateNo', 'trailerNo', 'containerNo', 'businessType',
                    'transportStatus', 'transportMode', 'productionType', 'unloadingDirection', 'productionName', 'oilGrade',
                    'isTransgenosis', 'isTransgenosis1', 'isTransgenosis2', 'isTransgenosis3', 'isEdibleOilLabel', 'numberOfCrew',
                    'identityCard', 'vehicleLicense', 'driverLicense', 'tradingCard', 'documentation', 'lastTimePickUpCompanyName1',
                    'lastTimePickUpCompanyName2', 'lastTimePickUpCompanyName3', 'lastTimeUnloadingCompanyName1', 'lastTimeUnloadingCompanyName2',
                    'lastTimeUnloadingCompanyName3', 'lastTimeUnloadingGoodsName1', 'lastTimeUnloadingGoodsName2', 'lastTimeUnloadingGoodsName3',
                    'lastTimeUnloadingDate1', 'lastTimeUnloadingDate2', 'lastTimeUnloadingDate3', 'lastTimeUnloadingPhotos', 'screenshot',
                    'poundListPhoto1', 'cleaningWay', 'lastTimeCleaningDate', 'lastTimeCleaningPhotos', 'letterOfGuarantee', 'auditStatus',
                    'headstockPhoto', 'vehiclePhoto', 'rearPhoto', 'containerNoPhoto', 'tankPhoto', 'oilInletPhoto', 'oilDischargePortPhoto',
                    'leadSealingPic', 'isOdor', 'auditName1', 'auditTime1', 'auditName2', 'auditTime2', 'surveyorName', 'surveyorTime',
                    'inspectorSign1', 'inspectorSign2', 'inspectorSign3', 'inspectorSign4', 'inspectorSign5', 'openId', 'driverSign1',
                    'driverSign2', 'driverSign3', 'checkResult', 'samplingName', 'samplingTime', 'leadSealingName', 'leadSealingTime',
                    'rejectReason', 'rejectPhoto', 'certificate', 'productLabel', 'samplingPhoto', 'leadSealingPic1', 'onboardRecordForm',
                    'noticeOfDischarge', 'driverOpenId', 'aduitStatus', 'tankTop'))
            })
        },
        add() {
            this.edit({});
        },
        edit(record) {
            this.queryByTankerId(record.id)
            this.form.resetFields();
            this.model = Object.assign({}, record);
            this.visible = true;
            this.$nextTick(() => {
                this.form.setFieldsValue(pick(this.model, 'tank1', 'tank2', 'tank3', 'tank4', 'tank5', 'tank6', 'tank7',
                    'tank8', 'tank9', 'tank10', 'tank11', 'tank12', 'tank13', 'tank14', 'tank15', 'tank16', 'tank17',
                    'tank18', 'tank19', 'tank20', 'tank21', 'tank22', 'tank23', 'tank24', 'deliverCompany', 'receiptCompany',
                    'fleet', 'driverName', 'phoneNum', 'idCard', 'plateNo', 'trailerNo', 'containerNo', 'businessType',
                    'transportStatus', 'transportMode', 'productionType', 'unloadingDirection', 'productionName', 'oilGrade',
                    'isTransgenosis', 'isTransgenosis1', 'isTransgenosis2', 'isTransgenosis3', 'isEdibleOilLabel', 'numberOfCrew',
                    'identityCard', 'vehicleLicense', 'driverLicense', 'tradingCard', 'documentation', 'lastTimePickUpCompanyName1',
                    'lastTimePickUpCompanyName2', 'lastTimePickUpCompanyName3', 'lastTimeUnloadingCompanyName1', 'lastTimeUnloadingCompanyName2',
                    'lastTimeUnloadingCompanyName3', 'lastTimeUnloadingGoodsName1', 'lastTimeUnloadingGoodsName2', 'lastTimeUnloadingGoodsName3',
                    'lastTimeUnloadingDate1', 'lastTimeUnloadingDate2', 'lastTimeUnloadingDate3', 'lastTimeUnloadingPhotos', 'screenshot',
                    'poundListPhoto1', 'cleaningWay', 'lastTimeCleaningDate', 'lastTimeCleaningPhotos', 'letterOfGuarantee', 'auditStatus',
                    'headstockPhoto', 'vehiclePhoto', 'rearPhoto', 'containerNoPhoto', 'tankPhoto', 'oilInletPhoto', 'oilDischargePortPhoto',
                    'leadSealingPic', 'isOdor', 'auditName1', 'auditTime1', 'auditName2', 'auditTime2', 'surveyorName', 'surveyorTime',
                    'inspectorSign1', 'inspectorSign2', 'inspectorSign3', 'inspectorSign4', 'inspectorSign5', 'openId', 'driverSign1',
                    'driverSign2', 'driverSign3', 'checkResult', 'samplingName', 'samplingTime', 'leadSealingName', 'leadSealingTime',
                    'rejectReason', 'rejectPhoto', 'certificate', 'productLabel', 'samplingPhoto', 'leadSealingPic1', 'onboardRecordForm',
                    'noticeOfDischarge', 'driverOpenId', 'aduitStatus', 'tankTop'))
            })
        },
        //渲染流程表单数据
        showFlowData() {
            if (this.formBpm === true) {
                let params = { id: this.formData.dataId };
                getAction(this.url.queryById, params).then((res) => {
                    if (res.success) {
                        this.edit(res.result);
                    }
                });
            }
        },
        submitForm() {
            const that = this;
            // 触发表单验证
            this.form.validateFields((err, values) => {
                if (!err) {
                    that.confirmLoading = true;
                    let httpurl = '';
                    let method = '';
                    if (!this.model.id) {
                        httpurl += this.url.add;
                        method = 'post';
                    } else {
                        httpurl += this.url.edit;
                        method = 'put';
                    }
                    let formData = Object.assign(this.model, values);
                    console.log("表单提交数据", formData)
                    httpAction(httpurl, formData, method).then((res) => {
                        if (res.success) {
                            that.$message.success(res.message);
                            that.$emit('ok');
                        } else {
                            that.$message.warning(res.message);
                        }
                    }).finally(() => {
                        that.confirmLoading = false;
                    })
                }

            })
        },
        popupCallback(row) {
            this.form.setFieldsValue(pick(row, 'tank1', 'tank2', 'tank3', 'tank4', 'tank5', 'tank6', 'tank7',
                'tank8', 'tank9', 'tank10', 'tank11', 'tank12', 'tank13', 'tank14', 'tank15', 'tank16', 'tank17',
                'tank18', 'tank19', 'tank20', 'tank21', 'tank22', 'tank23', 'tank24', 'deliverCompany', 'receiptCompany',
                'fleet', 'driverName', 'phoneNum', 'idCard', 'plateNo', 'trailerNo', 'containerNo', 'businessType',
                'transportStatus', 'transportMode', 'productionType', 'unloadingDirection', 'productionName', 'oilGrade',
                'isTransgenosis', 'isTransgenosis1', 'isTransgenosis2', 'isTransgenosis3', 'isEdibleOilLabel', 'numberOfCrew',
                'identityCard', 'vehicleLicense', 'driverLicense', 'tradingCard', 'documentation', 'lastTimePickUpCompanyName1',
                'lastTimePickUpCompanyName2', 'lastTimePickUpCompanyName3', 'lastTimeUnloadingCompanyName1', 'lastTimeUnloadingCompanyName2',
                'lastTimeUnloadingCompanyName3', 'lastTimeUnloadingGoodsName1', 'lastTimeUnloadingGoodsName2', 'lastTimeUnloadingGoodsName3',
                'lastTimeUnloadingDate1', 'lastTimeUnloadingDate2', 'lastTimeUnloadingDate3', 'lastTimeUnloadingPhotos', 'screenshot',
                'poundListPhoto1', 'cleaningWay', 'lastTimeCleaningDate', 'lastTimeCleaningPhotos', 'letterOfGuarantee', 'auditStatus',
                'headstockPhoto', 'vehiclePhoto', 'rearPhoto', 'containerNoPhoto', 'tankPhoto', 'oilInletPhoto', 'oilDischargePortPhoto',
                'leadSealingPic', 'isOdor', 'auditName1', 'auditTime1', 'auditName2', 'auditTime2', 'surveyorName', 'surveyorTime',
                'inspectorSign1', 'inspectorSign2', 'inspectorSign3', 'inspectorSign4', 'inspectorSign5', 'openId', 'driverSign1',
                'driverSign2', 'driverSign3', 'checkResult', 'samplingName', 'samplingTime', 'leadSealingName', 'leadSealingTime',
                'rejectReason', 'rejectPhoto', 'certificate', 'productLabel', 'samplingPhoto', 'leadSealingPic1', 'onboardRecordForm',
                'noticeOfDischarge', 'driverOpenId', 'aduitStatus', 'tankTop'))
        },
    }
}
</script>